﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Zimmerreservierung.Model;

namespace Zimmerreservierung.Forms
{
    public partial class FormKundeAuswaehlen : Form
    {
        public int SelectedKundenId = 0;

        public FormKundeAuswaehlen(List<Kunde> kunden)
        {
            InitializeComponent();

            var bindinglist = new BindingList<Kunde>(kunden);
            var source = new BindingSource(bindinglist, null);
            comboBox1.DataSource = source;
            
        }

        private void button1_Click(object sender, EventArgs e)
        {
            // kunde ausgewählt
            Kunde auswahl = comboBox1.SelectedValue as Kunde;
            SelectedKundenId = auswahl.Id;
            this.Close();
        }
    }
}
